home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / virus / vhtvc111.lha / Virus_CheckerII / Install_Virus_Checker < prev    next >
Text File  |  1999-01-12  |  13KB  |  475 lines

  1. ;VirusCheckerII's New Installer Script
  2. ;
  3. ;$VER: Virus_CheckerII_Installer v1.01 (20.10.98) ß1998 by Alex van Niel
  4.  
  5.  
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;;;
  8. ;;; Get the version and revision number of file/device/library/OS/etc
  9. ;;;
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11. ;
  12. ; Taken from original Installer Script of Virus_Checker and Virus_CheckerII
  13. ;
  14. ; INPUTS: Item    ; Name of device/file/library/etc. "" for OS version
  15. ;
  16. ; OUTPUTS: VerN        ; (long) version/revision number
  17. ;          Ver        ; Version number
  18. ;          Rev        ; Revision number
  19. ; NOTE: Both Ver and Rev returned as 0 if "WV_Item" does not exist
  20. ;
  21. (procedure WhatVersion
  22.     (
  23.     (if (= VerN "")
  24.         (set VerNum (getversion))        ; For OS
  25.         (set VerNum (getversion VerN)))    ; For other "files"
  26.     (set Ver (/ VerNum 65536))
  27.     (set Rev (- VerNum (* Ver 65536)))
  28.     )
  29. )
  30.  
  31. (procedure P_setvcenv
  32.     (
  33.  
  34.         (set #vcpath_env    (cat
  35.                                 ("setenv Virus_Checker_Path \"%s\"\n" @default-dest)
  36.                                 ("copy env:Virus_Checker_Path envarc: quiet\n")
  37.                             )
  38.         )
  39.  
  40.         (textfile
  41.             (dest "T:VCEnvSet")
  42.             (append #vcpath_env)
  43.         )
  44.  
  45.         (execute "T:VCEnvSet")
  46.         (delete "T:VCEnvSet")
  47.     )
  48. )
  49.  
  50.     (set    #hail        (cat    "VirusCheckerII Installation Utility\n\n"
  51.                                 "VirusCheckerII is ShareWare,\n"
  52.                                 "please consider registering.\n\n"
  53.                                 "VirusCheckerII is (c)1997/1998 by Alex van Niel\n"
  54.                                 "Virus_Checker is (c)1990/1995 by John Veldthuis\n"
  55.                         )
  56.     )
  57.     (set    #fullinstall    "Full Install")
  58.     (set    #update        "Update")
  59.     (set    #where_vc    (cat    "First, please select the directory to put Virus_CheckerII in.\n\n"
  60.                                 "The Installer will create a drawer called \'Virus_CheckerII\' "
  61.                                 "where all the files are put into. You don't need to make "
  62.                                 "one yourself."
  63.                         )
  64.     )
  65.     (set    #whatinstall    (cat    "Would you like to install VirusCheckerII fully "
  66.                                 "or do you want to update a currently installed version?"
  67.                         )
  68.     )
  69.     (set    #installhelp    (cat    "Full Install, installs the complete program, "
  70.                                     "update, installs only the files that are new or not "
  71.                                     "yet present.\n"
  72.                                     "Libraries, the latest brainfile and the main executable "
  73.                                     "are good examples of files that would possibly be copied "
  74.                                     "if they have been changed since the last release."
  75.                             )
  76.     )
  77.     (set    #allfiles        "Copying all files from distribution archive")
  78.     (set    #copyallfiles    (cat    "The Installer is about to copy all the files from the "
  79.                                     "distribution archive to \"%s\". It will not check "
  80.                                     "the versions of the files, so beware.\n\n"
  81.                                     "If you already have installed, VirusCheckerII and want "
  82.                                     "to update it, please press abort, start the installer again and choose "
  83.                                     "update instead."
  84.                             )
  85.     )
  86.     (set    #none            "None")
  87.     (set    #bestplace        (cat    "The best place to have VirusCheckerII started from is from the User-startup "
  88.                                     "that way it can monitor the system as early as possible and allowable. "
  89.                                     "You can also choose WBStartup for easy acces and still a pretty good safety "
  90.                                     "Choose User-Startup if you want to have the installer add a line to your "
  91.                                     "User-Startup, else choose WBStartup and the installer will copy a special "
  92.                                     "icon to the WBStartup drawer, or None if you aren't sure yet and want to decide later."
  93.                             )
  94.     )
  95.     (set    #vcrunfrom        (cat    "To have VirusCheckerII start as early as possible, choose User-Startup "
  96.                                     "and the installer will add a line to your User-Startup. VirusCheckerII will then "
  97.                                     "automatically startup when you boot your system.\n\n"
  98.                                     "To have VirusCheckerII start from your WBStartup, choose the related button. "
  99.                                     "The installer will copy a special icon to the WBStartup and VirusCheckerII will "
  100.                                     "be started when your workbench is launched.\n\n"
  101.                                     "If you aren\'t sure when you want VirusCheckerII to be started, just press None "
  102.                                     "that way you can choose later."
  103.                             )
  104.     )
  105.     (set    #vcrunchoose    "Please choose how/when you want VirusCheckerII to be started...")
  106.     (set    #adddat            "The installer needs to add the following line to your \s:User-Startup\ file\n\n%s")
  107.  
  108.     (set    #copyvcbrain    "Copying VirusChecker.brain")
  109.     (set    #copyxfdlib        "Copying xfdmaster.library")
  110.     (set    #copybguilib    "Copying bgui.library")
  111.     (set    #copyxfddecrs    "Copying XFD external decrunchers, please choose which ones to install")
  112.     (set    #copyxvslib        "Copying Xvs.Library")
  113.  
  114.     (set    #copyinglibs    "The installer is about to install the libraries supplied with this archive into LIBS:, ")
  115.  
  116.     (set    #copyvcproject    "Copying and Adjusting VirusChecker startup Icon")
  117.     (set    #adjtooltype    "Adjusting ToolType")
  118.     (set    #makevcdir      "Creating VirusCheckerII drawer")
  119.     (set    #skip            "Skip this part")
  120.     (set    #proceed        "Proceed")
  121.     (set    #proceedhelp    (cat    "Press \'Proceed\' to install the part, or press skip if you don't want "
  122.                                     "to install that particular part but do want to continue installing "
  123.                                     "Virus_CheckerII. You could also press Abort Install to stop the complete "
  124.                                     "installation."
  125.                             )
  126.     )
  127.     (set    #upd-guide        "Updating Guide")
  128.     (set    #upd-main        "Updating Virus_CheckerII")
  129.     (set    #upd-brain        "Updating VirusChecker.brain")
  130.     (set    #upd-xvs        "Updating Xvs.Library")
  131.     (set    #updating        (cat    "The installer is about to update Virus_CheckerII in\n"
  132.                                     "\'%s\'.\n"
  133.                                     "Is this correct?\n"
  134.                                     "(If you want to have Virus_CheckerII updated in another directory, "
  135.                                     "then press \'No\' and you will automatically get a requester to "
  136.                                     "choose the correct drawer)\n"
  137.                                     "If you have not installed Virus_CheckerII fully before, then "
  138.                                     "I recommend that you abort this installation for now and choose "
  139.                                     "\'Full Install\' instead."
  140.                             )
  141.     )
  142.     (set    #versions        (cat
  143.                                     "Currently installed versions that might be updated:\n\n"
  144.                                     "Virus_CheckerII v%ld.%ld\n"
  145.                                     "VirusChecker.brain v%ld.%ld\n"
  146.                                     "VirusChecker.guide v%ld.%ld\n"
  147.                                     "Xvs.Library v%ld.%ld\n\n"
  148.                                     "Versions in archive:\n"
  149.                                     "Virus_CheckerII v%ld.%ld\n"
  150.                                     "VirusChecker.brain v%ld.%ld\n"
  151.                                     "VirusChecker.guide v%ld.%ld\n"
  152.                                     "Xvs.Library v%ld.%ld\n"
  153.                                     "(Files that have version 0.0 are in fact not installed)"
  154.                             )
  155.     )
  156.     (set    #install_dir    "Please specify where VirusCheckerII should be installed\n(A drawer will be created here)")
  157.     (set    #update_dir        "Please specify path of already installed VirusCheckerII")
  158.  
  159.     (set    #needtoreset    (cat    "Virus_CheckerII is an Anti Virus utility which is worked upon almost "
  160.                                     "24hrs a day. Though, problems might rise in spite of this. Most of these "
  161.                                     "problems however are caused by not or half reading the documentation. "
  162.                                     "A lot of problems can be solved or even prevented by reading the documenation. "
  163.                                     "I therefore recommend that you read the documentation from front to back. It "
  164.                                     "might happen that some problems are not solved even then, if so, feel free to "
  165.                                     "contact me. How can be found in the documentation.\n\n"
  166.                                     "I personally recommend that you also reset your computer now so that Virus_CheckerII "
  167.                                     "can start properly."
  168.                        )
  169.     )
  170.  
  171.     (set    #yes            "Yes")
  172.     (set    #no                "No")
  173.  
  174. (welcome)
  175. (message #hail)
  176.  
  177. (set    #dofull    (askbool    (default 1)
  178.                             (prompt #whatinstall)
  179.                             (help #installhelp)
  180.                             (choices #fullinstall #update)
  181.                 )
  182. )
  183.  
  184. (if #dofull
  185.  
  186.     (
  187.         (complete    0)
  188.         (message #where_vc)
  189.         (set    #vcpath        (askdir    (prompt #install_dir)
  190.                                     (help @askdir-help)
  191.                                     (default @default-dest)
  192.                             )
  193.         )
  194.  
  195.         (set    @default-dest    (tackon #vcpath "Virus_CheckerII"))
  196.  
  197.         (P_setvcenv)
  198.  
  199.         (    ;copying all the files from the distribution
  200.             (message    (#copyallfiles    @default-dest))
  201.             (copyfiles    (prompt    #allfiles)
  202.                         (source    "")
  203.                         (dest    @default-dest)
  204.                         (all)
  205.                         (infos)
  206.                         (optional nofail askuser )
  207.             )
  208.  
  209.             (complete    45)
  210.  
  211.             (set    #user    (askbool    (default 1)
  212.                                         (prompt #copyinglibs)
  213.                                         (help #proceedhelp)
  214.                                         (choices #proceed #skip)
  215.                             )
  216.             )
  217.  
  218.             (if #user
  219.  
  220.                 (
  221.                     (complete    50)
  222.  
  223.                     (copylib (prompt #copyxfdlib)
  224.                         (help @copylib-help)
  225.                         (source "libs/xfdmaster.library")
  226.                         (dest "LIBS:")
  227.                         (optional nofail askuser)
  228.                     )
  229.  
  230.                     (complete    60)
  231.  
  232.                     (copylib (prompt #copybguilib)
  233.                         (help @copylib-help)
  234.                         (source "libs/bgui.library")
  235.                         (dest "LIBS:")
  236.                         (optional nofail askuser)
  237.                     )
  238.  
  239.                     (complete    70)
  240.  
  241.                     (copyfiles (prompt #copyxfddecrs)
  242.                         (help @copyfiles-help)
  243.                         (source "libs/xfd")
  244.                         (dest "LIBS:xfd")
  245.                         (all)
  246.                         (optional nofail askuser)
  247.                         (confirm)
  248.                     )
  249.  
  250.                     (complete 80)
  251.  
  252.                     (copylib (prompt #copyxvslib)
  253.                         (help @copylib-help)
  254.                         (source "libs/Xvs.library")
  255.                         (dest "LIBS:")
  256.                         (optional nofail askuser)
  257.                     )
  258.  
  259.  
  260.                 )
  261.  
  262.             )
  263.         )
  264.  
  265.         (complete    90)
  266.  
  267.         (
  268.             (message    #vcrunfrom)
  269.             (set    #vc-startup    (askchoice
  270.                                     (prompt #vcrunchoose)
  271.                                     (help #bestplace)
  272.                                     (default 0)
  273.                                     (choices "User-Startup" "WBStartup" #none)
  274.                                 )
  275.             )
  276.             (if (= #vc-startup 0)
  277.                 (
  278.                     (set    #vc-cmd    (tackon @default-dest "Virus_CheckerII"))
  279.                     (startup @app-name    (prompt (#adddat #vc-cmd))
  280.                                         (help @startup-help)
  281.                                         (command #vc-cmd)
  282.                     )
  283.                     (copylib (prompt #copyvcbrain)
  284.                         (help @copylib-help)
  285.                         (source "VirusChecker.brain")
  286.                         (dest "L:")
  287.                         (optional nofail askuser)
  288.                     )
  289.  
  290.                 )
  291.             )
  292.  
  293.             (if (= #vc-startup 1)
  294.                 (
  295.                     (copyfiles    (prompt #copyvcproject)
  296.                                 (help @copylib-help)
  297.                                 (source "VC_II_Project.info")
  298.                                 (dest "SYS:WBStartup/")
  299.                                 (newname "Virus_CheckerII.info")
  300.                                 (optional nofail askuser)
  301.                     )
  302.  
  303.                     (set #vcprojecttool (tackon @default-dest "Virus_CheckerII"))
  304.                     (tooltype
  305.                         (prompt #adjtooltype)
  306.                         (dest "SYS:WBStartup/Virus_CheckerII")
  307.                         (setdefaulttool #vcprojecttool)
  308.                     )
  309.                 )
  310.  
  311.             )
  312.             (if (= #vc-startup 2)
  313.             )
  314.  
  315.             (complete    100)
  316.  
  317.         )
  318.  
  319.     )    ;then statement
  320.  
  321.     (    ;else statement
  322.  
  323.         (complete    0)
  324.  
  325.         (if (= (exists "ENV:Virus_Checker_Path" (noreq)) 1)
  326.  
  327.             (set @default-dest (getenv "Virus_Checker_Path"))
  328.  
  329.             (
  330.                 (set    #updpath    (askdir    (prompt #update_dir)
  331.                                             (help @askdir-help)
  332.                                             (default @default-dest)
  333.                                     )
  334.                 )
  335.                 (set    @default-dest    #updpath)
  336.             )
  337.         )
  338.  
  339.         (set    #userupd    (askbool    (default 1)
  340.                                         (prompt    (#updating    @default-dest))
  341.                                         (help    #upddirhelp)
  342.                                         (choices    #yes    #no)
  343.                             )
  344.         )
  345.  
  346.         (if        (=    #userupd    0)
  347.             (
  348.                 (set    #updpath    (askdir    (prompt #update_dir)
  349.                                             (help @askdir-help)
  350.                                             (default @default-dest)
  351.                                     )
  352.                 )
  353.                 (set    @default-dest    #updpath)
  354.             )
  355.         )
  356.  
  357.         (complete    10)
  358.  
  359.         (if (= (exists "L:VirusChecker.brain" (noreq)) 1)
  360.             (
  361.                 (set    VerN    "L:VirusChecker.brain")
  362.                 (WhatVersion)
  363.                 (set    #brainver    Ver)
  364.                 (set    #brainrev    Rev)
  365.             )
  366.  
  367.             (
  368.                 (set    VerN    (tackon    @default-dest    "VirusChecker.brain"))
  369.                 (WhatVersion)
  370.                 (set    #brainver    Ver)
  371.                 (set    #brainrev    Rev)
  372.             )
  373.         )
  374.  
  375.         (set    VerN    (tackon    @default-dest    "Virus_CheckerII"))
  376.         (WhatVersion)
  377.         (set    #mainver    Ver)
  378.         (set    #mainrev    Rev)
  379.  
  380.         (set    VerN    (tackon    @default-dest    "Virus_Checker.guide"))
  381.         (WhatVersion)
  382.         (set    #guidever    Ver)
  383.         (set    #guiderev    Rev)
  384.  
  385.  
  386.         (set    VerN    "Virus_CheckerII")
  387.         (WhatVersion)
  388.         (set    #main2ver    Ver)
  389.         (set    #main2rev    Rev)
  390.  
  391.         (set    VerN    "VirusChecker.brain")
  392.         (WhatVersion)
  393.         (set    #brain2ver    Ver)
  394.         (set    #brain2rev    Rev)
  395.  
  396.         (set    VerN    "Virus_Checker.guide")
  397.         (WhatVersion)
  398.         (set    #guide2ver    Ver)
  399.         (set    #guide2rev    Rev)
  400.  
  401.  
  402.         (set    VerN    "Libs:Xvs.Library")
  403.         (WhatVersion)
  404.         (set    #xvsver    Ver)
  405.         (set    #xvsrev    Rev)
  406.  
  407.         (set    VerN    "Libs/Xvs.Library")
  408.         (WhatVersion)
  409.         (set    #xvs2ver    Ver)
  410.         (set    #xvs2rev    Rev)
  411.  
  412.         (message    (#versions    #mainver    #mainrev    #brainver    #brainrev    #guidever    #guiderev    #xvsver    #xvsrev    #main2ver    #main2rev    #brain2ver    #brain2rev    #guide2ver    #guide2rev    #xvs2ver    #xvs2rev))
  413.  
  414.         (copylib (prompt #upd-xvs)
  415.             (help @copylib-help)
  416.             (source "libs/Xvs.library")
  417.             (dest "LIBS:")
  418.             (optional nofail askuser)
  419.         )
  420.  
  421.         (copylib    (prompt #upd-guide)
  422.                     (help @copylib-help)
  423.                     (source "Virus_Checker.guide")
  424.                     (dest @default-dest)
  425.                     (optional nofail askuser)
  426.         )
  427.  
  428.         (complete    30)
  429.  
  430.         (copylib    (prompt #upd-main)
  431.                     (help @copylib-help)
  432.                     (source "Virus_CheckerII")
  433.                     (dest @default-dest)
  434.                     (optional nofail askuser)
  435.         )
  436.         (complete    50)
  437.  
  438.         (if (= (exists "L:VirusChecker.brain" (noreq)) 1)
  439.             (
  440.                 (copylib (prompt #upd-brain)
  441.                     (help @copylib-help)
  442.                     (source "VirusChecker.brain")
  443.                     (dest "L:")
  444.                     (optional nofail askuser)
  445.                 )
  446.                 (copylib (prompt #upd-brain)
  447.                     (help @copylib-help)
  448.                     (source "VirusChecker.brain")
  449.                     (dest @default-dest)
  450.                     (optional nofail askuser)
  451.                 )
  452.             )
  453.  
  454.             (
  455.                 (copylib (prompt #upd-brain)
  456.                     (help @copylib-help)
  457.                     (source "VirusChecker.brain")
  458.                     (dest @default-dest)
  459.                     (optional nofail askuser)
  460.                 )
  461.             )
  462.         )
  463.  
  464.         (P_setvcenv)
  465.  
  466.         (complete    100)
  467.  
  468.     )
  469. )
  470.  
  471. (if (= #vc-startup 2)
  472.     (exit)
  473.     (exit    #needtoreset)
  474. )
  475.